<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <a href="#one">跳转到第一个界面</a>
    <a href="#two">跳转到第二个界面</a>
    <div id="box"></div>
    <script>
        var one = '<h1>第一个界面</h1>'
        var two = '<p>第二个界面</p><input>'
        window.onhashchange = function () {
            if(location.hash == '#one') {
                box.innerHTML = one
            }else{
                box.innerHTML = two
            }
        }
    </script>
</body>
</html>